-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various improvements in the rendering of math and references. rST ZIPs now support $...$ for inline math. #953
base: main
Are you sure you want to change the base?
Conversation
This should be merged after #951 [edit: which is now merged]. |
76e676a
to
7d04605
Compare
7d04605
to
4e905e4
Compare
When reviewing this, please also check how reference links and the References section look after the CSS changes. That might vary between browsers; I only tested desktop Firefox (115.1.0esr) and Chromium (124.0.6367.118) on Debian. It's difficult to test mobile without having GitHub Pages rendering of PRs. |
4e905e4
to
cb9a900
Compare
cb9a900
to
976d268
Compare
f472b90
to
a9fc3ae
Compare
7e35f12
to
7c2bd6c
Compare
7c2bd6c
to
00e90e7
Compare
else | ||
if [ "x$1" = "x--pandoc" ]; then | ||
# Not actually MathJax. KaTeX is compatible if we use the right headers. | ||
pandoc --mathjax --from=markdown --to=html "${inputfile}" --output="${outputfile}.temp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I had to add --mathjax
(relative to the pandoc
command that was previously in the Makefile
) as part of switching from MathJax to KaTeX. That's because KaTeX is compatible with MathJax's representation of math spans as:
<span class="math">\(latex code\)</span>
(class="math inline"
also works.) Previously the \(
\)
delimiters were not being added by pandoc
; that's what the --mathjax
option does. multimarkdown
adds them without an explicit option.
The reason why I didn't just immediately switch to MultiMarkdown in this PR, is that it is not packaged for Linux distributions. It has to be built from source (requiring CMake, for the current version). The build is pretty straightforward though, so I'll switch the default once I've added it to the docker image and added some documentation. |
…tent between Markdown and reStructuredText. (This also anticipates a possible switch from Pandoc to Multimarkdown; the changes are designed to work with both.) Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
(zip-guide *incorrectly* said that we were already using KaTeX. This has been wrong since zcash#645.) Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
This supports MultiMarkdown as well as Pandoc, using `make MARKDOWN_OPTION=--mmd` Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
00e90e7
to
96dafb2
Compare
Make the style of reference links and references (almost) consistent between Markdown and reStructuredText.
The
$...$
syntax can now be —and is— used in rST, except in tables and headings. fixes Make$...$
work in reStructuredText ZIPs #952The reason why
$...$
doesn't work in general for tables and headings is that replacing it with:math:`...`
throws off the column-sensitive markup. Things like that are why column-sensitive markup is a bad idea.In most cases when using
$...$
followed by a punctuation mark, there is no need to manually correct spacing (in either rST or Markdown). Therender.sh
script does it automatically if required. This does not apply to:math:`...`
.Math is rendered using KaTeX instead of MathJax. fixes Switch from MathJax to KaTeX for ZIP rendering #432, fixes The size of rendered math in ZIPs is inconsistent between reloads #375
The rendering of math from Markdown is greatly improved. Previously it could only handle simple expressions that could be rendered at low quality as text; now it supports everything that KaTeX supports, and the quality of rendering is consistent (if not quite up to
pdflatex
standards).This PR is also preparation for switching to MultiMarkdown. MultiMarkdown fixes the duplicate reference bug (References are duplicated in the rendering of Markdown ZIPs #893) and also has some nice features like colspan in tables (use$n$ $n$ columns).
|
characters on the right-hand-side of a table entry to make it span